package com.smh.demo1.a01;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * @author shiminghui
 * @date 2025/4/9 18:47
 * @description: TODO
 */
@Aspect
@Component
@Slf4j
public class AOPDemo {

    @Before("execution(* com.smh.demo1.a01.Component2.*(..))") // 切面表达式, 匹配com.smh.demo1.Component2包下的所有方法
    public void before(JoinPoint joinPoint) { // 切点
        log.debug("切面方法{}执行", joinPoint.getSignature().getName());
    }

}
